<?php 
include_once("../function.php");
//print_r($_GET);//Array ( [price] => 3250 [pid] => 159 [type] => 1 [uid] => 5 [oid] => 142 )
extract($_GET);//

?>
<!doctype html>
<html>
 <head>
  <title>我的订单</title>
  <meta charset="utf-8"/>
    <style>
  *{margin:0px;padding:0px;}
#big{
	 width:100%;
	 height:780px;
	 border:1px solid red;
	 margin:20px auto;
	}
ul{
	 list-style-type:none;float:left;
	}
li{
	float:left;
	margin-left:15px;
	font-size:0.5em;
	color:#a5a5a5;
	
	}
span{
	float:right;
	}
.p0{
	margin-left:20px;
	}
.xs{
	margin-left:20px;
	height:50px;
	width:auto;
	border:0px solid red;
	}
.xc1{
	font-size:2em;
	margin-right:50px;
	}
#xw{
	width:100%;
	height:40px;
	border:1px solid;
	background:#1F81B0;
	line-height:40px;
	font-size:2.5em;
	
	}
	ul a:-webkit-any-link {text-decoration:none;
    color:white;
    cursor: pointer;}
ul li{margin-left:35px;
    color:white;
	
}
 	
#fl{
	margin-left:50px;
	font-size:1.3em;
	}
#s{float:left;margin-left:30px;font-size:20px;width:200px;height:20px;}
#middle{width:100%;height:auto;border:0px solid red;}
a{text-decoration:none;color:black;}
#tb{margin:50px auto;width:600px;height:600px;border:0px solid red;}
#news{margin-top:50px;width:100%;height:auto;border:0px solid blue;}
#zuo{width:200px;height:auto;border:0px solid red;}
	</style>
 </head>

 <body>
<?php include_once("./login_top.php");?>
<div id="s">
	<span class="sp1"><font color="#b6b6b6">当前所在></font>新闻</span>
</div>
<div id="middle">
<div id="news">
	<div id="zuo">
	<?php $sql="select * from ts_news_cate where level=1";
			$res=mysqli_query($link,$sql);
			if(is_object($res))
			{
				if(mysqli_num_rows($res)>0)
				{
					$www=array();
					while(($list=mysqli_fetch_assoc($res))!=false)
					{
						$www[]=$list;
					}
				}
			}?>
<?php foreach($www as $k){?>
		
				<div style="border:0px solid blue;font-size:25px;margin-left:50px;color:#33cc00" ><?=$k["cname"]?></div>
					<?php $sql="select * from ts_news_cate where fid=$k[cid]";
					$res=mysqli_query($link,$sql);
					if(is_object($res))
					 {
						$arr2=array();
						while(($one1=mysqli_fetch_assoc($res))!=false)
						 {
							$arr2[]=$one1;
						 }
						foreach($arr2 as $vo)
						 {?>
							<div style="margin-left:50px;font-size:20px;" style="display:none"><a href="news.php?cid=<?=$vo['cid']?>" target=""><?=$vo["cname"]?></a></div>
						<?php }
					}?>
						</div>
			<?php }?>
					
		
	</div>
	<div id="you" style="width:800px;height:auto;border:2px solid #c1c1c1;float:left;margin-left:300px;margin-top:-650px;">
<?php if(isset($cid)){
		$sql="select * from ts_news_cate where cid=$cid";
		$res=mysqli_query($link,$sql);//var_dump($res);
		if(is_object($res))
		{
			if(mysqli_num_rows($res)>0)
			{
				$one1=mysqli_fetch_assoc($res);
				$fid=$one1['fid'];
				$cid=$one1['cid'];
			}
		}
		$sql="select * from ts_news_cate where cid=$fid";
		$res=mysqli_query($link,$sql);//var_dump($res);
		if(is_object($res))
		{
			if(mysqli_num_rows($res)>0)
			{
				$one2=mysqli_fetch_assoc($res);
				$fid=$one2['fid'];
			}
		}
		//print_r($one2);
	 $sql="select * from ts_news where news_cid=$cid";
				$res=mysqli_query($link,$sql);//var_dump($res);
				if(is_object($res))
				{
					if(mysqli_num_rows($res)>0)
					{
						$arr3=array();
						while(($one=mysqli_fetch_assoc($res))!=false)
						 {
							$arr3[]=$one;
						 }
					}
		
				}
				//print_r($arr3);
			if(isset($arr3))
			{
				foreach($arr3 as $j)
				{
					
				}
			}
	}?>
		<table border=0 cellspacing=0>
			<tr>
				<td><font size=6 color="#804040"><?=$one2['cname']?> ></font><font size="6" color="#ffcc00"> <?=$one1['cname']?></font></td>
				
			</tr>
			<tr>
			<td width="500px" height="50px"><font size="5px" color="#663333">新闻标题: <?=$j['news_title']?></font></td>
				
				
			</tr>
			<tr>
				<td><font size="4px" color="#663333">发布时间: <?=date("Y-m-d",$j['news_pubtime'])?></font></td>
					
				
			</tr>
			<tr>
				<td width="500px" height="40px"><font size="4px" color="#663333">发布人: <?=$j['news_author']?></font></td>
			</tr>
			<?php if(isset($j['new_img'])&&$j['new_img']!=''){?>
			<tr>
				<td><img src="../<?=$j['new_img']?>" width="100px" height="70px"></td>
			</tr>
			<?php }?>
			<?php $n=$j['news_click']+1; $sql="update ts_news set news_click='$n' where news_id=$j[news_id]";
				$res=mysqli_query($link,$sql);
				if($res)
				{
					if(mysqli_affected_rows($link)>0)
					{
						
					}
				}
			?>
			<tr>
				<td width="500px" height="50px"><font size="4" color="#663333">浏览量:<?=$j['news_click']?></font></td>
			</tr>
			<tr>
				<td width="500px" height="80px"><font size="4" color="#663333"><?=$j['news_descp']?></font></td>
				
			</tr>
			<tr>
				<td width="500px" height="100px"><font size="4" color="#7f7f7f"><?=$j['news_content']?></font></td>
				
			</tr>
		</table>
	</div>

</div>	
<div><hr></div>	
	<div style="clear:both;width:100%;height:150px;border:0px solid yellow;">
	<?php $sql="select * from ts_news_cate where level=1";
		  $res=mysqli_query($link,$sql);
		  if(is_object($res))
		  {
			  if(mysqli_num_rows($res)>0)
			  {
				$arr=array();
				while(($one=mysqli_fetch_assoc($res))!=false)
				  {
				  $arr[]=$one;
				  }
				 }?>
					
				<?php foreach($arr as $v){?>
				<div style="float:left;margin-left:250px;border:0px solid red;font-size:16px;margin-top:7px;"><div style="border:px solid blue;font-size:19px;margin-left:-8px;"><?=$v["cname"]?></div>
					<?php $sql="select * from ts_news_cate where fid=$v[cid]";
					$res=mysqli_query($link,$sql);
					if(is_object($res))
					 {
						$arr2=array();
						while(($one1=mysqli_fetch_assoc($res))!=false)
						 {
							$arr2[]=$one1;
						 }
						// print_r($arr2);
						foreach($arr2 as $vo)
						 {?>
							<div><a href="news.php?cid=<?=$vo['cid']?>"><?=$vo["cname"]?></a></div>
						<?php }
					}?>
						</div>
			<?php }
					
			 }
	?>
</div>
		
<hr color="#e5e5e5"/>
<div id="db">
	<div style="margin-left:800px;margin-top:10px;">
			关于我们|法律声明|工作机会|联系我们
	</div>

	<div style="margin-left:600px;margin-top:20px;color:#a8a8a8;">
		Copyright@2013 Thinksite Co.Let night reserved 经营许可证编号：苏A-12345678
	</div>
</div>
<script type="text/javascript">	
order_detail=document.getElementsByClassName("order_detail");
order_details=document.getElementsByClassName("order_details");
for(let i=0;i<order_detail.length;i++)
{
	order_detail[i].onclick=function()
	{
		if(order_details[i].style.display=="none")
		{
		order_details[i].style.display="table-row";
		}
		else
		{
			order_details[i].style.display="none"
		}
	}
}

</script>
 </body>
</html>
